
import request from '@/utils/request'
export default {
    //根据no查询设施
    queryByNo(no) {
        const url = `/v3/facility/facility/queryByNo?no=${no}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //查询所有设施组
    getfacilityGroupAll(data) {
        const url = '/v3/facility/facilityGroup/queryByCondition'
        return request({
            url: url,
            method: 'post',
            data: {
                groupStatus: false,
                ...data
            }
        })
    },
    getFacilityListByConditionAll(data) {
        const url = '/v3/facility/facility/queryByCondition'
        return request({
            url: url,
            method: 'post',
            data: {
                ...data
            }
        })
    },
    //查询设施组
    queryFacilityGroup(no) {
        const url = `/v3/facility/facilityGroup/queryFacilityDetailsByGroupNo?no=${no}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //查询设施类型
    queryFacilityType() {
        const url = `/v3/facility/facilityType/queryByCondition`
        return request({
            url: url,
            method: 'post'
        })
    },
    //分页查询设施
    queryPageByCondition(data) {
        const url = `/v3/facility/facility/queryPageByCondition`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                entity: {
                    ...data.entity,
                    farmingTypeNo: sessionStorage.farmingTypeNo
                }
            }
        })
    },

    //分页查询设施
    queryBatchPageByCondition(data) {
        const url = `/fish/batch/facilityPond/queryPageByCondition`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                entity: {
                    ...data.entity,
                    farmingTypeNo: sessionStorage.farmingTypeNo
                }
            }
        })
    },

    //查询地块
    queryFacilityArea(no) {
        const url = `/v3/facility/facility/queryByNo?no=${no}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //添加设施
    add(data) {
        const url = `/v3/facility/facility/add`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                farmingTypeNo: sessionStorage.farmingTypeNo
            }
        })
    },
    //编辑设施
    edit(data) {
        const url = `/v3/facility/facility/edit`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                farmingTypeNo: sessionStorage.farmingTypeNo
            }
        })
    },
    edit(data) {
        const url = `/v3/facility/facility/edit`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                farmingTypeNo: sessionStorage.farmingTypeNo
            }
        })
    },
    /**
     * 
     * @param {facilityNo}  
     * @param {facilityStatus}
     * @returns 
     */
    editFalseStatus(data) {
        const url = `/v3/facility/facility/editFalseStatus`
        return request({
            url: url,
            method: 'post',
            data
        })
    },

}
